package com.cch.cooperation.biz.common.valid;

import com.cch.cooperation.biz.common.valid.util.ServiceValidUtil;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * 服务层切面
 *
 * @author cch on 2021/03/16
 **/
@Aspect
@Order(0)
@Component
public class ServiceValidAspect {

    @Before("execution(* com.cch.cooperation..service.*.*(..))")
    public void paramValid(JoinPoint joinPoint) {
        String functionName = joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName();
        ServiceValidUtil.validServiceFun(functionName, joinPoint.getArgs());
    }

}
